A PLC (Programmable Logic Controller) is, for example, configured by a plurality of units such as a CPU (Central Processing Unit) including a microprocessor for executing a user program, and an IO (Input Output) unit responsible for signal input from external switches and sensors and signal output to external relays and actuators. The PLC executes a control operation while exchanging data via a PLC system bus and/or field network among the units for every execution cycle of the user program.
The control of operations of machineries, facilities, and the like sometimes include a motion control for controlling the motion of a motor. Conventionally, in such motion control, control processing (execution of motion computation program) for periodically outputting a command value to a motor driver, which drives a motor, is typically carried out in a motion controller arranged separate from the PLC. However, increase in speed of the microprocessor and the communication network is progressing in the field of information technology. Thus, not only the user program, but also the motion computation program can be executed in one microprocessor in the PLC using such techniques.
For example, Patent Document 1 discloses a configuration of processing a motion control function of controlling a motor and a PLC function of executing a sequence computation (user program) with one CPU. More specifically, Patent Document 1 discloses executing “fixed-period motion control processing and each axis processing” and “high speed sequence processing” for every cycle of a basic clock, and furthermore, executing “low speed sequence processing” or “non-fixed period motion control processing” in the remaining time of each basic clock cycle.
An electronic cam is sometimes used in the motion control. The electronic cam realizes the operation of a mechanical CAM in electronic control, so that tooling change of the CAM, fine-tuning of the CAM shape, and the like can be freely and easily carried out. Non-patent Document 1 describes a CAM table for realizing the electronic cam. Non-patent Document 1 also describes a CAM variable.
Patent document 2 discloses an electronic cam control device. The electronic cam control device includes a stroke bottom dead point setting unit, an addition movement amount setting unit, a position command calculating unit, and a stroke bottom dead point changing unit. The addition movement amount setting unit sets addition movement data for changing the stroke bottom dead point position. When the stroke bottom dead point change command is input, the position command calculating unit sequentially adds the addition movement amount corresponding to the stroke bottom dead point position set in the stroke bottom dead point setting unit and the addition movement data set in the addition movement amount setting unit to a CAM positioning amount A, and sequentially outputs the addition result as a position command value with respect to an output shaft. When the stroke bottom dead point change command is input, the stroke bottom dead point changing unit sequentially adds the addition movement amount corresponding to the addition movement data set in the addition movement amount setting unit to the stroke bottom dead point position set in the stroke bottom dead point setting unit, and sequentially updates the stroke bottom dead point position set in the stroke bottom dead point setting unit with the addition result.
Patent Document 3 discloses a positioning control system of a motor. The positioning control system of the motor updates a movement actual time Rti for every frequency dividing period, obtains a dimensionless time ti from the updated movement actual time Rti, and obtains a dimensionless position Sij corresponding to the dimensionless time ti using a CAM curve table. The positioning control system of the motor obtains an actual position sij by multiplying a stroke hj to the obtained dimensionless position Sij. The positioning control system of the motor carries out the computation of obtaining the actual position sij for the selected N CAM curves. The positioning control system of the motor adds the obtained N actual positions sij. The positioning control system of the motor feedback controls a rotation position of the motor with a difference sTi−sTi-1 of an addition value sTi and an addition value sTi-1 obtained in the previous frequency dividing period as a command value.
Patent Documents 4 to 6 disclose devices for synchronously driving a main shaft motor and a dependent shaft motor. Patent Document 7 discloses a manufacturing method and a manufacturing device (see FIG. 1) of a composite stretchable member using an electronic cam.    Patent Document 1: Japanese Unexamined Patent Publication No. 2007-140655    Patent Document 2: Japanese Unexamined Patent Publication No. 2006-293692    Patent Document 3: Japanese Unexamined Patent Publication No. 8-339218    Patent Document 4: Japanese Unexamined Patent Publication No. 8-126375    Patent Document 5: Japanese Unexamined Patent Publication No. 9-289788    Patent Document 6: Japanese Unexamined Patent Publication No. 10-174478    Patent Document 7: Japanese Unexamined Patent Publication No. 2010-260323    Non-patent Document 1: Technical Specification PLC open—Technical Committee 2—Task Force, Function blocks for motion control (Formerly Part 1 and Part 2), PLC open Working Draft, Version 1.99—Release for comments—till Aug. 16, 2010